//
// Created by 77873 on 2020/9/28 0028.
//

#ifndef MINEVIDEOPLAYER_MINEVIDEO_H
#define MINEVIDEOPLAYER_MINEVIDEO_H

#include "MineQueue.h"
#include "MinePlayStatus.h"
#include "MineCallJava.h"

extern "C" {
    #include <libavcodec/avcodec.h>
    #include <libavutil/time.h>
    #include <libavutil/imgutils.h>
    #include <libswscale/swscale.h>
};


class MineVideo {
public:
    //视频流的index
    int streamIndex = -1;
    AVCodecContext *avCodecContext = NULL;
    AVCodecParameters *codecParameters=NULL;

    MineQueue *queue=NULL;

    MinePlayStatus *playStatus=NULL;
    MineCallJava *mineCallJava=NULL;
    AVRational time_base;


    //使用线程获取到解码数据

    pthread_t thread_play;
public:
    MineVideo(MinePlayStatus *playStatu,MineCallJava *callJava);
    ~MineVideo();

    void play();

    void release();
};


#endif //MINEVIDEOPLAYER_MINEVIDEO_H
